package teaching.io;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;

public class EmpTest {

  public static void main(String[] args) {
    /*
    File file = new File("d:/emp.dat");
    
     Employee employee = new Employee(1, "zhangsan", 2000d);
     RandomAccessFile randomAccessFile = null;
     try {
     randomAccessFile = new RandomAccessFile(file, "rw");
     employee.write(randomAccessFile);
     System.out.println("ok");
     } catch (IOException e) {
     e.printStackTrace();
     } finally {
     try {
     randomAccessFile.close();
     } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     }
     }

    Employee employee2 = new Employee();
    try {
      randomAccessFile = new RandomAccessFile(file, "r");
      employee2.read(randomAccessFile);
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      try {
        randomAccessFile.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }

    System.out.println(employee2);
*/
  }

}
